<!--
 * @Author: your name
 * @Date: 2021-05-26 10:36:26
 * @LastEditTime: 2021-06-01 17:20:16
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \遵义报名\zunyi\src\components\myRadio.vue
-->
<template>
  <div>
    <el-radio-group v-model="radio" @change="handlerChange" :disabled="isDisabled">
      <el-radio v-for="item of valueArray" :key="item.label" :label="item.label">{{
        item.content
      }}</el-radio>
    </el-radio-group>
  </div>
</template>

<script>
export default {
  props: {
    valueArray: {//数据数组
      type: Array,
      required: true,
    },
    // currentItem:{//当前选中的项
    //   required: true,
    // },
    isDisabled:{
        type:Boolean,
        default:false
    }
  },
  model:{
    //   prop:"currentItem",//当前的选中的项（传进来的值）
      event:"change"//事件的改变
  },
  data() {
    return {
      radio: this.valueArray[0].label,
    };
  },
  methods:{
      handlerChange(val){
          console.log(val);
          this.$emit("change",val)
      }
  },
  created(){
    this.$emit("change",this.radio)
  }
};
</script>

<style>
</style>